﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WinClient.Core;
using WinClient.Service.Interfaces.Module1;

namespace WinClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ServiceProxy proxy = new ServiceProxy();
            ICustomerService customerService = proxy.GetService<ICustomerService>();

            label1.Text = customerService.CurrentVersion;

            listBox1.Items.Clear();
            List<string> names = customerService.GetNames();

            names.ForEach( p=> listBox1.Items.Add( p));
            Console.WriteLine(customerService.GetNames().Count);
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem menuItem = sender as ToolStripMenuItem;
            switch (menuItem.Text)
            {
                case "About":
                    AboutBox1 about = new AboutBox1();
                    about.ShowDialog();
                    break;


                default:
                    //donothing
                    break;
            }

        }
    }
}
